<template>
	<el-drawer title="费用调整申请详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-form-item label="申请标题" prop="title">{{form.title}}
					</el-form-item>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="申请类型" prop="adjustType">{{}}
								<el-tag v-if="form.adjustType==1" type="success">削减预算</el-tag>
								<el-tag v-else-if="form.adjustType==2" type="warning">增加预算</el-tag>
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="调整项目" prop="projectId">{{form.pTitle}}</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="原预算额" prop="oldTotalCost">{{form.oldTotalCost}}/万元</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="调整金额" prop="newTotalCost">
								{{form.newTotalCost}}/万元
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="申请人" prop="applyUser">{{form.applyUserName}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="审批人" prop="approvalUser">{{form.approvalUserName}}</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="调整原因">
						<div v-html="form.remark"></div>
					</el-form-item>
					<el-form-item label="相关附件" prop="attachId">
						<attach-menu :attachIds="form.attachId" :roleFlag="3" :preview="true"></attach-menu>
					</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'
export default {
	emits: ['success', 'closed'],
	components: {
		AttachMenu,
	},
	data() {
		return {
			loading: false,
			form: {
				recordId:'',
				title: '',
				adjustType: '1',
				projectId:'',
				oldTotalCost:0,
				newTotalCost:0,
				applyUser:'',
				approvalUser:'',
				remark:'',
				attachId:''
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(model){
			this.model=model;
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data){
			this.form.recordId=data.recordId
			this.form.title=data.title
			this.form.adjustType=data.adjustType
			this.form.projectId=data.projectId
			this.form.pTitle=data.pTitle
			this.form.oldTotalCost=data.oldTotalCost
			this.form.newTotalCost=data.newTotalCost
			this.form.applyUserName=data.applyUserName
			this.form.approvalUserName=data.approvalUserName
			this.form.remark=data.remark
			this.form.attachId=data.attachId
		},
	}
}
</script>

<style>
</style>
